package org.example.impl;

import org.apache.dubbo.config.ProtocolConfig;
import org.apache.dubbo.config.annotation.Service;
import org.example.ProviderMainAnno;
import org.example.service.HelloService;
import org.yy.MyHolder;

import javax.servlet.ServletRequest;


@Service
public class HelloServiceImpl implements HelloService {
    @Override
    public String sayHello(String name) {
        ProtocolConfig bean = ProviderMainAnno.context.getBean(ProtocolConfig.class);
        String request = MyHolder.getRequest();
        if (request != null) {
            System.out.println("请求ip=" + request);
        }
        return bean.getPort() + ",hello:" + name;
    }
}
